//
// Created by jsjxsy on 2022/8/29.
//
#include <iostream>
#include <string>
using namespace std;
template<typename NameType, typename AgeType>
class Person;
template<typename NameType, typename AgeType>
 void show2(Person<NameType, AgeType> &p){
  cout << "name=" << p.name << ", age=" << p.age << endl;
}
template<typename NameType, typename AgeType>
class Person {
 public:
  Person(NameType name, AgeType age) : name(name), age(age) {}
  //内部实现友元
  friend void show(Person<NameType, AgeType> &p) {
    cout << "name=" << p.name << ", age=" << p.age << endl;
  }
  friend void show2<>(Person<NameType, AgeType> &p);
 public:
  NameType name;
  AgeType age;
};

int main() {
  Person<string, int> p("lisi", 10);
  show(p);
  show2(p);
  return 0;
}

